+2006-12-26 Carlos Garnacho <carlosg@gnome.org>
+
+ Fix small regressions in GtkNotebook tab detaching. Bug #378852.
+
+ * gtk/gtknotebook.c (gtk_notebook_do_arrow): grab focus to allow tabs
+ scrolling when hovering with a detached tab.
+ (gtk_notebook_stop_reorder): Do not deparent the wrong tab if the
+ focus tab has changed during a tab DND operation.
+ (gtk_notebook_drag_end): ensure that the dropped tab gets focused.
+ (gtk_notebook_paint): do not take cur_page as a reference to paint the
+ box if it's detached.
+ (gtk_notebook_calculate_tabs_allocation): focus_tab may be different
+ to the detached tab if we hover the arrows during a tabs detaching
+ operation, do not allocate it unconditionally in 0,0.
+
2006-12-26 Carlos Garnacho <carlosg@gnome.org>
Expose improvements for GtkNotebook. Bug #383435
dir = ARROW_IS_LEFT (arrow) ? GTK_DIR_UP : GTK_DIR_DOWN;
else
dir = ARROW_IS_LEFT (arrow) ? GTK_DIR_LEFT : GTK_DIR_RIGHT;
+
+ gtk_widget_grab_focus (widget);
gtk_widget_child_focus (widget, dir);
}
}
GtkNotebookPage *page;
priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
- page = notebook->cur_page;
+
+ if (priv->operation == DRAG_OPERATION_DETACH)
+ page = priv->detached_tab;
+ else
+ page = notebook->cur_page;
if (!page)
return;
gtk_notebook_stop_reorder (GTK_NOTEBOOK (widget));
+ if (priv->detached_tab)
+ gtk_notebook_switch_page (GTK_NOTEBOOK (widget), priv->detached_tab, -1);
+
GTK_BIN (priv->dnd_window)->child = NULL;
gtk_widget_destroy (priv->dnd_window);
priv->dnd_window = NULL;
if (!notebook->first_tab)
notebook->first_tab = notebook->children;
- if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, notebook->cur_page) ||
- !GTK_WIDGET_MAPPED (notebook->cur_page->tab_label))
+ if (!GTK_WIDGET_MAPPED (notebook->cur_page->tab_label))
page = GTK_NOTEBOOK_PAGE (notebook->first_tab);
else
page = notebook->cur_page;
page->allocation = child_allocation;
- if (page == notebook->cur_page)
+ if ((page == priv->detached_tab && priv->operation == DRAG_OPERATION_DETACH) ||
+ (page == notebook->cur_page && priv->operation == DRAG_OPERATION_REORDER))
{
- if (priv->operation == DRAG_OPERATION_REORDER ||
- priv->operation == DRAG_OPERATION_DETACH)
- {
- /* needs to be allocated at 0,0
- * to be shown in the drag window */
- page->allocation.x = 0;
- page->allocation.y = 0;
- }
+ /* needs to be allocated at 0,0
+ * to be shown in the drag window */
+ page->allocation.x = 0;
+ page->allocation.y = 0;
}
- else
+
+ if (page != notebook->cur_page)
{
switch (tab_pos)
{